<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{ .title }}</title>
</head>
<body>
<input type="button" id="btnAdd" value="发送jsonp请求" onclick="SaveData()" />
</body>
<script src="static/js/jquery-2.1.4.min.js"></script>
<script>
    function SaveData() {
        var name = "qxw";
        $.ajax({
            type: "get",
            url: "http://localhost:8088/JSONP",
            dataType: "jsonp",
            //这两句指定回调函数为：CallBackUser
            jsonp: 'callback',
            data: {name:name},
            success: function (data) {
                console.log(data)
                //jsonp请求，不会执行此函数，只执行CallBackUser
                alert(data.name);
            }
        });
    }

</script>
</html>